package com.example.singleton;

import org.junit.jupiter.api.Test;

/**
 * @Description TODO
 * @Date 2021/10/21 20:35
 * @Author ZhangJi
 * @Version 1.0
 */
public class SingletonPatternTest {

  @Test
  public void singletonPatternTest(){
    // 饿汉单例模式
    HungrySingleObject.getSingle().showMessage();
    // 懒汉单例模式
    LazySingleObject.getSingleObject().showMessige();
    // 双检锁单例模式 https://www.cnblogs.com/xz816111/p/8470048.html
    DCLSingleObject.getSingleObject().showMessage();
  }

}
